<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>添加、编辑新闻-后台管理-{$site.SITE_INFO.name}</title>
        <php>
            $addCss="";
            $addJs="";
            $currentNav ='资讯管理 > 添加编辑新闻';
        </php>
        <include file="Common:intoHead" />
    </head>
    <body>
        <div class="wrap">
            <include file="Common:head" />
            <div class="mainBody">
                <include file="Common:left" />
                <div id="Right">
                    <div class="Item hr">
                        <div class="current">添加编辑新闻</div>
                    </div>
                    <form>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
                            <php>if($site['SITE_INFO']['LANG_SWITCH_ON']=='1'){</php>
                            <tr>
                                <th>语言选择：</th>
                                <td>
                                    <select name="info[lang]">
                                        <option value="zh-cn" <if condition="$info['lang'] eq 'zh-cn'">selected</if> >简体中文</option>
                                        <option value="en-us" <if condition="$info['lang'] eq 'en-us'">selected</if> >English</option>
                                    </select></td>
                            </tr>
                            <php>}</php>
                            <tr>
                                <th width="100">广告标题：</th>
                                <td><input id="title" type="text" class="input" size="60" name="info[title]" value="{$info.title}"/> <a href="javascript:void(0)" id="checkNewsTitle">检测是否重复</a></td>
                            </tr>

                            <tr>
                                <th width="100">发布状态：</th>
                                <td><label><input type="radio" name="info[status]" value="0" <if condition="$info.status eq 0"> checked="checked"</if> /> 文章审核状态</label> &nbsp; <label><input type="radio" name="info[status]" value="1" <if condition="$info.status eq 1"> checked="checked"</if> /> 文章已发布状态</label> </td>
                            </tr>
                            <tr>
                                <th>所属行业：</th>
                                <td>
                                    <select name="info[cid]">
                                        <volist name="list" id="vo">
                                            <if condition="$vo[cid] eq $info[cid]">
                                                <option value="{$vo.cid}" selected="selected">{$vo.fullname}</option>
                                                <else/>
                                                <option value="{$vo.cid}">{$vo.fullname}</option>
                                            </if>
                                        </volist>
                                    </select>
                                    <select name="info[need]">
                                        <option value="生理需求" <if condition="$info['need'] eq '生理需求'">selected</if> >生理需求</option>
                                        <option value="安全需求" <if condition="$info['need'] eq '安全需求'">selected</if> >安全需求</option>
                                        <option value="归属于爱需求" <if condition="$info['need'] eq '归属于爱需求'">selected</if> >归属于爱需求</option>
                                        <option value="尊重需求" <if condition="$info['need'] eq '尊重需求'">selected</if> >尊重需求</option>
                                        <option value="认知需求" <if condition="$info['need'] eq '认知需求'">selected</if> >认知需求</option>
                                        <option value="审美需求" <if condition="$info['need'] eq '审美需求'">selected</if> >审美需求</option>
                                        <option value="自我实现需求" <if condition="$info['need'] eq '自我实现需求'">selected</if> >自我实现需求</option>
                                        <option value="超自我实现需求" <if condition="$info['need'] eq '超自我实现需求'">selected</if> >超自我实现需求</option>
                                    </select>
                                    <select name="info[country]">
                                        <option value="中国" <if condition="$info['country'] eq '中国'">selected</if> >中国</option>
                                        <option value="美国" <if condition="$info['country'] eq '美国'">selected</if> >美国</option>
                                        <option value="英国" <if condition="$info['country'] eq '英国'">selected</if> >英国</option>
                                        <option value="巴西" <if condition="$info['country'] eq '巴西'">selected</if> >巴西</option>
                                        <option value="韩国" <if condition="$info['country'] eq '韩国'">selected</if> >韩国</option>
                                        <option value="日本" <if condition="$info['country'] eq '日本'">selected</if> >日本</option>
                                        <option value="法国" <if condition="$info['country'] eq '法国'">selected</if> >法国</option>
                                        <option value="意大利" <if condition="$info['country'] eq '意大利'">selected</if> >意大利</option>
                                    </select>
                                    <select name="info[year]">
                                        <option value="2016" <if condition="$info['year'] eq '2016'">selected</if> >2016</option>
                                        <option value="2015" <if condition="$info['year'] eq '2015'">selected</if> >2015</option>
                                        <option value="2014" <if condition="$info['year'] eq '2014'">selected</if> >2014</option>
                                        <option value="2013" <if condition="$info['year'] eq '2013'">selected</if> >2013</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>文章图片：</th>
                                <td>
                                    <input type="text" id="url1" class="input" size="40" name="image" value="{$img_info.savepath}"/>
                                    <notempty name="img_info"><input type="hidden" name="image_id" value="{$img_info.id}" /></notempty>
                                    <input type="button" class="btn " id="image1" value="选择图片" />
                                </td>

                            </tr>
                            <tr>
                                <th>小需求：</th>
                                <td><input type="text" class="input" size="60" name="info[littleneed]" value="{$info.littleneed}"/>如：“生物本能”，“自然环境
                                    ”</td>
                            </tr>
                            <tr>
                                <th>企业主：</th>
                                <td><input type="text" class="input" size="60" name="info[man]" value="{$info.man}"/></td>
                            </tr>
                            <tr>
                                <th>品牌名：</th>
                                <td><input type="text" class="input" size="60" name="info[brand]" value="{$info.brand}"/></td>
                            </tr>
                            <tr>
                                <th>标签名：</th>
                                <td><input type="text" class="input" size="60" name="info[keywords]" value="{$info.keywords}"/>如：“性欲”，“玩耍”</td>
                            </tr>
                            <tr>
                                <th>消费者洞察：</th>
                                <td><textarea class="input" style="height: 60px; width: 600px;" name="info[description]">{$info.description}</textarea></td>
                            </tr>
                            <tr>
                                <th>广告语：</th>
                                <td><textarea class="input" style="height: 60px; width: 600px;" name="info[summary]">{$info.summary}</textarea> 如果不填写则系统自动截取文章前200个字符</td>
                            </tr>
                            <tr>
                                <th>摄众意念：</th>
                                <td><textarea id="content" class="input" style="height: 300px; width: 100%;" name="info[content]">{$info.content}</textarea></td>
                            </tr>
                        </table>
                        <input type="hidden" name="info[id]" value="{$info.id}" />
                    </form>
                    <div class="commonBtnArea" >
                        <button class="btn submit">提交</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <include file="Common:foot" />
        <js href="--PUBLIC--/kindeditor/kindeditor.js,--PUBLIC--/kindeditor/lang/zh_CN.js"/>
        <script type="text/javascript">
            $(function(){var  content ;
                KindEditor.ready(function(K) {
                    content = K.create('#content',{
                        allowFileManager : true,
                        uploadJson:'--PUBLIC--/kindeditor/php/upload_json.php?dirname=news'
                    });
                });
                $("#checkNewsTitle").click(function(){
                    $.getJSON("__URL__/checkNewsTitle", { title:$("#title").val(),id:"{$info.id}"}, function(json){
                        $("#checkNewsTitle").css("color",json.status==1?"#0f0":"#f00").html(json.info);
                    });
                });
                $(".submit").click(function(){
                    content.sync();
                    commonAjaxSubmit();
                    return false;
                });
            });
        </script>
        <script>
            KindEditor.ready(function(K) {
                var editor = K.editor({
                    allowFileManager : true,
                    uploadJson:'--PUBLIC--/kindeditor/php/upload_json.php?dirname=news'
                });
                K('#image1').click(function() {
                    editor.loadPlugin('image', function() {
                        editor.plugin.imageDialog({
                            imageUrl : K('#url1').val(),
                            clickFn : function(url, title, width, height, border, align) {
                                K('#url1').val(url);
                                editor.hideDialog();
                            }
                        });
                    });
                });
            });
        </script>
    </body>
</html>
